// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   GetResumenAction.java

package org.fiel.admin.struts.actions;

import java.io.PrintStream;
import javax.servlet.ServletRequest;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import org.apache.struts.config.ActionConfig;
import org.fiel.admin.dao.ResumenDAO;

// Referenced classes of package org.fiel.admin.struts.actions:
//            AdminAction

public final class GetResumenAction extends AdminAction
{

    public GetResumenAction()
    {
    }

    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
        throws Exception
    {
        HttpSession session = request.getSession();
        ActionErrors errors = new ActionErrors();
        java.util.List resumenes = null;
        ResumenDAO rDAO = new ResumenDAO();
        try
        {
            if(!isAuthorized(request))
                throw new Exception("Usuario no autorizado para esta operaci\363n.");
            resumenes = rDAO.retrieveResumenes();
        }
        catch(Exception e)
        {
            System.out.println(e.toString());
            errors.add("org.apache.struts.action.GLOBAL_ERROR", new ActionError("error.exception"));
            errors.add("org.apache.struts.action.GLOBAL_ERROR", new ActionError("error.detail", e.getMessage()));
        }
        request.setAttribute("resumenes", resumenes);
        if(mapping.getAttribute() != null)
            if("request".equals(mapping.getScope()))
                request.removeAttribute(mapping.getAttribute());
            else
                session.removeAttribute(mapping.getAttribute());
        if(!errors.isEmpty())
        {
            saveErrors(request, errors);
            return mapping.findForward("failed");
        } else
        {
            return mapping.findForward("success");
        }
    }
}
